package app

import (
	"geekbang-go-homework/week04/pkg/transport"
	"os"

	"google.golang.org/grpc/grpclog"
)

// Option is an application option.
type Option func(o *options)

type options struct {
	sigs    []os.Signal
	logger  grpclog.LoggerV2
	servers []transport.Server
}

func WithLogger(log grpclog.LoggerV2) Option {
	return func(o *options) {
		o.logger = log
	}
}

func WithServers(servers ...transport.Server) Option {
	return func(o *options) {
		o.servers = servers
	}
}

func WithSignal(sigs ...os.Signal) Option {
	return func(o *options) {
		o.sigs = sigs
	}
}
